package jeecg.business.service.impl.keyinfo;

import java.util.List;

import jeecg.business.entity.keyinfo.KeyinfoEntity;
import jeecg.business.entity.keyinfo.KeyinfoTextEntity;
import jeecg.business.service.keyinfo.KeyinfoTextServiceI;

import org.jeecgframework.core.common.service.impl.CommonServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service("keyinfoTextService")
@Transactional
public class KeyinfoTextServiceImpl extends CommonServiceImpl implements KeyinfoTextServiceI {
	public void setText4List(List<KeyinfoEntity> infolist){
		if(infolist == null || infolist.size() == 0) return ;
		String ids = "";
		for(KeyinfoEntity k : infolist){
			ids += ","+k.getId();
		}
		List<KeyinfoTextEntity> textList = findByQueryString(" from KeyinfoTextEntity where id in ('"+ids.replace(",", "','")+"')");
		for(KeyinfoEntity k : infolist){
			for(KeyinfoTextEntity t : textList)
				if(t.getId().equals(k.getId()))
					k.setText(t);
		}
	}
}